﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace LibraryManagement.ThongKeSach
{
    public partial class FormTKSach : DevExpress.XtraEditors.XtraForm
    {
        public FormTKSach()
        {
            InitializeComponent();
            DataSetSach datasetsach = new DataSetSach();
            DataTable t = datasetsach.Tables.Add();
            t.Columns.Add("stt", Type.GetType("System.String"));
            t.Columns.Add("thl", Type.GetType("System.String"));
            t.Columns.Add("slm", Type.GetType("System.String"));
            t.Columns.Add("tl", Type.GetType("System.String"));
            DataRow r;
            for (int i = 0; i < ThongKeSach.dtb.Rows.Count; i++)
            {
                r = t.NewRow();
                t.Rows.Add(r);
                r["stt"] = ThongKeSach.dtb.Rows[i][0].ToString();
                r["thl"] = ThongKeSach.dtb.Rows[i][1].ToString();
                r["slm"] = ThongKeSach.dtb.Rows[i][2].ToString();
                r["tl"] = ThongKeSach.dtb.Rows[i][3].ToString();
            }
            ReportSach rs = new ReportSach();
            rs.SetDataSource(datasetsach.Tables[1]);
            crystalReportViewer1.ReportSource = rs;
            crystalReportViewer1.Refresh();

        }
    }
}